E2E framework plus tests#3829
Draft
joe-ayoub-segment wants to merge 225 commits into
Draft
Conversation
Cover single subscribe/unsubscribe (by email and by userId), batch bulk
subscribe with per-item multistatus, and the client-side validation paths
(missing identifier, >6 items, differing subscriptions in a batch). Group IDs
are read from env (E2E_ITERABLE_MESSAGE_CHANNEL_ID / _MESSAGE_TYPE_ID /
_EMAIL_LIST_ID) rather than hardcoded; document all required env vars in the
destination's __e2e__/index.ts.
The /api/subscriptions/{group}/{id}/... endpoints are gated per Iterable
project and must be enabled by Iterable, so the HTTP fixtures fail with a 404
"Endpoint not found for project" until that is done. The verboseFailureHint on
those fixtures explains this so the failure is self-diagnosing.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Update the 'Batch add and remove users' e2e fixture so one user ID does not exist in Amplitude. Verifies the valid users still succeed (200) while the nonexistent user is returned in skipped_ids and surfaced as a per-item 400 with the correct error message. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copies the LinkedIn DMP Company Segment sync action (account-based marketing) from linkedin-company-audience-hooks (PR #3856) so we can build e2e-framework tests against it. - New updateCompanyAudience action + api.ts methods + index.ts registration - Deletes the destination-level snapshot.test.ts (incompatible with hook-gated actions), matching the source PR. - Intentionally omits metadata.json: this branch deliberately strips metadata.json from all destinations (kept only for amplitude). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
e8f851a to
09c16ef
Compare
Collapse duplicate company+action payloads within a batch into a single element sent to LinkedIn (keyed on normalized domain + organization URN, so case, whitespace, and bare-id-vs-URN forms of the same company match). LinkedIn's per-item result is fanned back out to every original payload index via a parallel index-list, so each input row still gets its own MultiStatusResponse entry. Expands the e2e duplicate fixture to interleave non-contiguous dupes, all three normalization paths, and two invalid rows. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Covers the same scenario as the e2e duplicate fixture: 12 input rows collapse to 4 unique company+action elements, and each LinkedIn result (success and error) is fanned back to every original index. Asserts the exact request body and the full per-item response array, exercising case/whitespace/bare-id-vs-URN normalization and interleaved no-identifier validation failures. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…zation Ports the fixes made on linkedin-company-audience-hooks (PR #3856): - api.ts: add LinkedIn-Version header to the DMP segment hook endpoints (listDmpSegmentsByAccount, getDmpSegmentById, createCompanyDmpSegment); without it LinkedIn returns 400 VERSION_MISSING. - functions.ts: treat any 2xx as success (was strict === 200); normalize identifiers once in validate() (trim + lowercase domain, trim id, whitespace-only treated as missing) so dedupe key and sent JSON agree. - Update dedup unit test + regenerate snapshots for the normalized (lower-cased) domain and the 202506 version. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Adds a batchWithMultistatus fixture that syncs 350 real company domains to the DMP Company Segment in a single request (well under LinkedIn's 5000-per-batch max), asserting a 201 for every row. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Ports from amplitudecohorts-fixes: clearer user_id field description (temporary seed user, automatic discovery, manual only as fallback) and narrows CreateAudienceJSON.id_type to 'BY_USER_ID' (the only supported value when creating a cohort). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Adds coverage for the previously-untested hook error/edge paths:
- create segment returns 201 but no x-restli-id -> CREATE_SEGMENT_FAILURE
- create segment request throws -> error result, no savedData
- fetch existing segment throws -> error result, no savedData
- getCompanyAudiences (dropdown) throws -> empty choices + error
- companyAudienceHook.performHook wrapper: delegates to performCompanyHook
and defaults hookInputs to {} when undefined
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Renames the columns_to_hash field to columns_to_transform and lets each
column select a hash_algorithm ('none' or 'sha256') and a normalize mode
('none' | 'lowercase' | 'trim' | 'lowercase_trim'), both defaulting to
'none'. Normalization runs before hashing via processHashing's cleaning
function, so already-hashed values are never normalized; hash_algorithm
'none' normalizes without hashing. All gated behind the existing
actions-s3-hashing flag.
- Extract SUPPORTED_HASH_ALGORITHMS / SUPPORTED_NORMALIZATIONS to
constants.ts; generate field choices from them.
- Lock the choice sub-fields to dropdown/typed input only
(disabledInputMethods).
- Unit tests for every normalize mode, normalize-then-hash, hash with
normalize none, already-hashed skip, and resolveColumnTransforms
validation; e2e fixtures for normalize-then-hash and normalize-only.
Verified end-to-end against the real S3 bucket: recomputed every SHA256
and confirmed normalize-only writes transformed plaintext.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Ports the copilot-comment fix from s3-shah256-support: the normalize field said "Already-hashed values are never normalized", which is inaccurate for the normalize-only path. Corrected to "Values that are already hashed are never re-hashed" (the guarantee processHashing actually provides). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a staging/integration branch, not a merge candidate. It exists so that end-to-end (e2e) tests can be authored for in-flight PRs before the e2e framework itself lands on main. Treat it as a working surface for e2e test development, not a feature PR.
Do not merge this into main. The underlying feature work lives in its own individual PRs (linked below), which go through the normal review/merge process on their own.
What's in this branch
Branched from feat/e2e-test-types-and-fixtures (the e2e framework PR #3817), with the following feature branches merged in to provide the destination code the e2e tests need to exercise:
One merge conflict was resolved (braze/index.ts — Track Calls preset subscribe filter, kept the superset that excludes Product Added/Product Removed, consistent with the dedicated presets those branches add).
e2e tests added
google-enhanced-conversions (first destination):
This fills the one e2e coverage gap for g-e-c: the prior fixtures covered Engage, JourneysV1, and RETL, but not the new Journeys V2 support.
Notes